package com.heyue.demo.Singleton;

/**
 * @author fenghe
 * @date 2022/2/12 12:55
 */
public class DoubleLock {
    /** 双重校验锁*/

    private static DoubleLock instance;

    private DoubleLock() {

    }

    public static DoubleLock getInstance() {
        if(instance == null) {
            synchronized (DoubleLock.class) {
                if(instance == null) {
                    instance = new DoubleLock();
                }
            }
        }
        return instance;
    }
}
